﻿using SharpAnalyzer.Utilities;
using System.Xml.Linq;
using System.Xml.Serialization;

namespace SharpAnalyzer.Entities
{
    [XmlInclude(typeof(ClassCouplingMetricResult))]
    [XmlRoot(ElementName = "Metric")]
    public class Metric
    {
        [XmlAttribute]
        public string Name { get; set; }

        [XmlIgnore]
        public object Value { get; set; }

        [XmlAttribute(AttributeName = "Value")]
        public string ValueText
        {
            get
            {
                if (this.Value != null)
                    return this.Value.ToString();
                return (string)null;
            }
            set
            {
                this.Value = value;
            }
        }
    }
}
